<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 例如： `abcba` / `你好世界世好你` 
        //返回值是布尔值

        var str = 'abcba'
        var arr = str.split('')
        var res = arr.reverse().join('')
        function fn(a,b){
            if(a === b){
                return true
            }else{
                return false
            }
        }
        console.log(fn(str,res));
    </script>
</body>
</html>